# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=okteta
pkgver=0.26.4
pkgrel=0
pkgdesc="KDE hex editor for viewing and editing the raw data of files"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
url="https://kde.org/applications/utilities/org.kde.okteta"
license="(LGPL-2.1-only OR LGPL-3.0-only) AND (GPL-2.0-only OR GPL-3.0-only) AND GFDL-1.2-only"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtdeclarative-dev qt5-qtscript-dev qt5-qtxmlpatterns-dev qt5-qttools-dev kbookmarks-dev kcompletion-dev kiconthemes-dev kcmutils-dev kio-dev knewstuff-dev kparts-dev kservice-dev kwidgetsaddons-dev kxmlgui-dev kcrash-dev kdbusaddons-dev kdoctools-dev kcodecs-dev kconfigwidgets-dev ki18n-dev qca-dev shared-mime-info"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/okteta/$pkgver/src/okteta-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_DESKTOPPROGRAM=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="2410fc73d2685405cef7d3d639ae202632f8781885803aed5e2e5e4ff8b48f7cdf4f8b9565edbc1b5fa3db4bb22ae90019f8cfdf4bda09def7badc559ebe02a7  okteta-0.26.4.tar.xz"
